//
// Created by Jisam on 2024/7/24 22:42.
// solve 洛谷 P1433 吃奶酪【DFS】+ 剪枝
#include <bits/stdc++.h>


using namespace std;

const double INF = numeric_limits<double>::infinity();
double ans;
vector<pair<double, double>> arr;
vector<vector<double>> dist;
vector<int> vis;

double dis(int i, int j) {
    return sqrt((arr[i].first - arr[j].first) * (arr[i].first - arr[j].first) +
                (arr[i].second - arr[j].second) * (arr[i].second - arr[j].second));
}

void dfs(int cur,int n,int ord, double sum) {
    if (sum >= ans) return;
    if (cur == n) {
        ans = min(sum, ans);
    } else {
        for (int i = 1; i < arr.size(); i++) {
            if (!vis[i]) {
                vis[i] = 1;
                cur++;
                dfs(cur,n,i, sum + dist[ord][i]);
                cur--;
                vis[i] = 0;
            }
        }
    }
}

int main() {
    int n;
    cin >> n;
    arr.resize(n + 1);
    dist.resize(n + 1, vector<double>(n + 1, 0));
    vis.resize(n + 1, 0);

    arr[0] = make_pair(0.0, 0.0);
    for (int i = 1; i <= n; i++) {
        cin >> arr[i].first >> arr[i].second;
    }
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= n; j++) {
            dist[i][j] = dis(i, j);
        }
    }
    ans = INF;
    dfs(0,n,0, 0);
    cout << fixed << setprecision(2) << ans << endl;
    return 0;
}